/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/*
 * Copyright (C) 2009, Edmundo Albuquerque de Souza e Silva.
 *
 * This file may be distributed under the terms of the Q Public License
 * as defined by Trolltech AS of Norway and appearing in the file
 * LICENSE.QPL included in the packaging of this file.
 *
 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 *
 */

package util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author alexandre
 */
public class VerificaCaractere {

    public static void main(String args[]) {

        Pattern pattern = Pattern.compile("\\S[^\\.a-zA-Z0-9_-]");
//         Pattern pattern = Pattern.compile("\\d{2}\\:\\d{2}\\:\\d{2}[\\s]?\\-\\W");
        Matcher matcher = pattern.matcher("copia-......de.flv");

        System.out.println("|" + matcher.find() + "|");
    }

    public static boolean Verifica(String url) {

        // Create matcher on file
//        String value = "Fabio Quintana á !@#$%¨&*()_+{[}]A^^AÂ<>;:?/-+§¬¢£³²¹°ºêîôû";
        String host = "";
        boolean result = false;
        //* \s -- whitespace (espaço em branco)
        //* \S -- non-whitespace (não seja espaço em branco)
        //* \w -- word character [a-zA-Z0-9] (caractere de palavra)
        //* \W -- non-word character (não caractere de palavra)
        //* \p{Punct} -- punctuation (pontuação)
        //* \p{Lower} -- lowercase [a-z] (minúsculas)
        //* \p{Upper} -- uppercase [A-Z] (maiúsculas)

        /* aqui você defini qual o tipo de avaliação */
        Pattern pattern = Pattern.compile("\\S[^\\.a-zA-Z0-9_-]");
        /* passa a String a ser avaliada */
        Matcher matcher = pattern.matcher(url);

        // Find all matches
//        while (matcher.find()) {
//            // imprimi o retorno tratado
//            host += matcher.group();
//        }
        return matcher.find();
    }
}
